package openase.audiosearch.comm.response.decoder;

import java.nio.ByteBuffer;

import openase.audiosearch.comm.StringFormatUtils;
import openase.audiosearch.comm.response.SearchResult;


public class SearchResultResponseDecoder implements ResponseDecoder<SearchResult> {

	public SearchResult decode(ByteBuffer inputBuffer) {
		int sz = inputBuffer.getInt();
		byte[] bytes = new byte[sz];
		inputBuffer.get(bytes);

		String result = StringFormatUtils.getUtf8(bytes);

		return new SearchResult(result);
	}
}
